inspector: Fix saving css
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 15:17:48 +0000 (11:17 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 15:19:43 +0000 (11:19 -0400)
g_file_replace_contents() does not accept -1
as length, unlike similar apis.

gtk/inspector/css-editor.c

index de79175ed26579865dd21870387147b4e0076dec..8047545b62d7a38cbab890bb2356312f72f8186c 100644 (file)
@@ -192,7 +192,7 @@ save_to_file (GtkInspectorCssEditor *ce,
 
   text = get_current_text (ce->priv->text);
 
-  g_file_replace_contents (file, text, -1,
+  g_file_replace_contents (file, text, strlen (text),
                            NULL,
                            FALSE,
                            G_FILE_CREATE_NONE,